#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
#include<stdlib.h>

int longestAlternatingSubarray(int* nums, int numsSize, int threshold) {
    int res = 0;
    int l = 0;
    int r = 0;
    for (int i = 0; i < numsSize; i++)
    {
        if (nums[i] % 2 != 0 || nums[i] > threshold)
            continue;
        l = i;
        r = i;//1
        for (int j = i + 1; j < numsSize; j++)
        {
            if (nums[j] <= threshold && nums[j - 1] % 2 != nums[j] % 2)
                r++;
            else
                break;
        }
        res = fmax(r - l + 1, res);
    }
    return res;
}

int main()
{
	return 0;
}